using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace Client
{
    public partial class MultiAuthen : Form
    {
        public MultiAuthen()
        {
            InitializeComponent();
        }

        private void MultiAuthen_Load(object sender, EventArgs e)
        {

        }

        private void button1_Click(object sender, EventArgs e)
        {
            int Num = 0;
            int NumSucc = 0;
            int NumFault = 0;
            Message[] mess = new Message[7];
            for (int i = 0; i < 7; i++)
            {
                mess[i] = new Message();
                mess[i].Header = "123456";
                mess[i].TypeIndentifier = "1234";
                mess[i].PrimaryBitMap = "1234567890123456";
                mess[i].ProcessingCode = "123456";
                mess[i].ResponseCode = "12";    
            }
            
            mess[0].UserID = textBox1.Text;
            mess[0].OTPNumber = textBox2.Text;

            mess[1].UserID = textBox3.Text;
            mess[1].OTPNumber = textBox4.Text;

            mess[2].UserID = textBox6.Text;
            mess[2].OTPNumber = textBox5.Text;

            mess[3].UserID = textBox8.Text;
            mess[3].OTPNumber = textBox7.Text;

            mess[4].UserID = textBox10.Text;
            mess[4].OTPNumber = textBox9.Text;

            mess[5].UserID = textBox12.Text;
            mess[5].OTPNumber = textBox11.Text;

            mess[6].UserID = textBox14.Text;
            mess[6].OTPNumber = textBox13.Text;
            
            for (int i = 0; i < 7; i++)
            {
                if (Login.login(mess[i]))
                {
                    NumSucc += 1;
                }
                else
                {
                    NumFault += 1;
                }
            }
            MessageBox.Show("Successful: " + NumSucc + "   Fault: " + NumFault);
        }
    }
}